

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>mount.ceph -- 用于挂载 Ceph 文件系统 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/doctools.js"></script>
        <script src="../../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="mount.fuse.ceph -- 在 /etc/fstab 里挂载 ceph-fuse" href="../mount.fuse.ceph/" />
    <link rel="prev" title="ceph-fuse -- 基于 FUSE 的 Ceph 客户端" href="../ceph-fuse/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../../../cephfs/">Ceph 文件系统</a></li>
      <li class="breadcrumb-item active">mount.ceph -- 用于挂载 Ceph 文件系统</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../../_sources/man/8/mount.ceph.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../../cephfs/#cephfs">CephFS 入门</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../cephfs/#id4">管理</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../../cephfs/#id5">挂载 CephFS</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../../../cephfs/client-config-ref/"> 客户端配置选项</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../cephfs/client-auth/"> 客户端认证</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../cephfs/mount-prerequisites/"> 挂载 CephFS: 前提条件</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../cephfs/mount-using-kernel-driver/"> 用内核驱动挂载 CephFS 文件系统</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../cephfs/mount-using-fuse/"> 用 FUSE 挂载 CephFS</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../cephfs/ceph-dokan/"> 在 Windows 上挂载 CephFS</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cephfs-shell/"> CephFS Shell 的用法</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../../cephfs/kernel-features/"> 内核驱动支持的功能</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-fuse/"> ceph-fuse 手册页</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#"> mount.ceph 手册页</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">提纲</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id2">描述</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">选项</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id6">实例</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id7">使用范围</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id8">功能适用范围</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id9">参考</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../mount.fuse.ceph/"> mount.fuse.ceph 手册页</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../cephfs/#id6">CephFS 内幕</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../cephfs/#id7">故障排除和灾难恢复</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../cephfs/#id9">更多细节</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="mount-ceph-ceph">
<h1>mount.ceph -- 用于挂载 Ceph 文件系统<a class="headerlink" href="#mount-ceph-ceph" title="Permalink to this heading"></a></h1>
<section id="id1">
<h2>提纲<a class="headerlink" href="#id1" title="Permalink to this heading"></a></h2>
<div class="line-block">
<div class="line"><strong>mount.ceph</strong> <em>name*&#64;*fsid</em>.*fs_name*=/[<em>subdir</em>] <em>dir</em> [-o <em>options</em> ]</div>
</div>
</section>
<section id="id2">
<h2>描述<a class="headerlink" href="#id2" title="Permalink to this heading"></a></h2>
<p><strong>mount.ceph</strong> 是在 Linux 主机上挂载 Ceph 文件系统的辅助程序。
它只负责把监视器主机名解析为 IP 地址、从硬盘读取认证密钥，
大多数实际工作由 Linux 内核客户端组件完成。
挂载一个 Ceph 文件系统的命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span><span class="o">.</span><span class="n">ceph</span> <span class="n">name</span><span class="o">@</span><span class="mi">07</span><span class="n">fe3187</span><span class="o">-</span><span class="mi">00</span><span class="n">d9</span><span class="o">-</span><span class="mi">42</span><span class="n">a3</span><span class="o">-</span><span class="mi">814</span><span class="n">b</span><span class="o">-</span><span class="mi">72</span><span class="n">a4d5e7d5be</span><span class="o">.</span><span class="n">fs_name</span><span class="o">=/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span> <span class="o">-</span><span class="n">o</span> <span class="n">mon_addr</span><span class="o">=</span><span class="mf">1.2.3.4</span>
</pre></div>
</div>
<p>其中， name 是 RADOS 客户端名字（以下简称 “RADOS 用户”，
意思是任何一个个人或系统角色，比如一个应用程序）。</p>
<p>挂载辅助程序可以从 ceph 配置文件读取集群的 FSID 。
我们建议通过 mount(8) 调用挂载辅助程序，像这样：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span> <span class="o">-</span><span class="n">t</span> <span class="n">ceph</span> <span class="n">name</span><span class="o">@.</span><span class="n">fs_name</span><span class="o">=/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span> <span class="o">-</span><span class="n">o</span> <span class="n">mon_addr</span><span class="o">=</span><span class="mf">1.2.3.4</span>
</pre></div>
</div>
<p>注意，这里的点 <code class="docutils literal notranslate"><span class="pre">.</span></code> 仍然是必要的，它是设备字符串的一部分。</p>
<p>mount 命令的第一个参数是设备部分，
它包括用来认证的 RADOS 用户名、文件系统名和
CephFS 内要挂载到挂载点的路径。</p>
<p>监视器地址可以通过 <code class="docutils literal notranslate"><span class="pre">mon_addr</span></code> 挂载选项传入，
可以传入多个监视器地址，用斜杠（ <cite>/</cite> ）分隔开即可。
只要有一个监视器地址就能成功挂载，
客户端可以从任意响应的监视器了解到所有监视器。
即便如此，最好指定多个监视器，免得正挂载的时候遇上那个挂了。
监视器地址的格式是 ip_address[:port] ，
如果端口没指定，就用默认端口 6789 。</p>
<p>如果没指定监视器地址，那么 <strong>mount.ceph</strong> 就会尝试用本地配置文件、和/或 DNS SRV 记录来获取监视器地址。
类似地，如果 Ceph 集群开启了认证（用的是 CephX ），
但命令却没指定 <code class="docutils literal notranslate"><span class="pre">secret</span></code> 和 <code class="docutils literal notranslate"><span class="pre">secretfile</span></code> ，
挂载辅助程序就会派生出一个子进程，
它会用标准的 Ceph 库例程去寻找密钥环、并从中获取密钥
（如果没指定监视器地址和 FSID ，也会一并寻找）。</p>
<p>可以挂载文件系统的子目录， mount 时，在设备部分的 “=” 后面、
紧跟着指定子目录的（绝对）路径即可。</p>
<p>mount 辅助程序的惯例是前两个选项分别为要挂载的设备和目标路径，
其它选项必须位于这些固定参数之后。</p>
</section>
<section id="id3">
<h2>选项<a class="headerlink" href="#id3" title="Permalink to this heading"></a></h2>
<section id="id4">
<h3>基础的<a class="headerlink" href="#id4" title="Permalink to this heading"></a></h3>
<dl class="simple">
<dt><strong class="command">conf</strong></dt><dd><p>ceph.cong 文件的路径。这是用于初始化 Ceph 上下文的，
之后就能自动发现监视器和认证密钥了。
默认会在标准路径内搜寻 ceph.conf 文件。</p>
</dd>
<dt><strong class="command">mount_timeout</strong></dt><dd><p>整数（秒）。默认：60</p>
</dd>
<dt><strong class="command">ms_mode=&lt;legacy|crc|secure|prefer-crc|prefer-secure&gt;</strong></dt><dd><p>设置客户端用来传输的连接模式，
可用模式有：</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">legacy</span></code>: 使用 v1 信使协议和集群通讯；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">crc</span></code>: 使用 v2 信使协议，没有线路加密；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">secure</span></code>: 使用 v2 信使协议，有线路加密；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">prefer-crc</span></code>: crc 模式，如果拒绝就是用 secure 模式；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">prefer-secure</span></code>: secure 模式，如果拒绝就是用 crc 模式；</p></li>
</ul>
</dd>
<dt><strong class="command">mon_addr</strong></dt><dd><p>集群监视器的地址，格式是 ip_address[:port] 。</p>
</dd>
<dt><strong class="command">fsid</strong></dt><dd><p>集群的 FSID ，可以用 <cite>ceph fsid</cite> 命令找到。</p>
</dd>
<dt><strong class="command">secret</strong></dt><dd><p>用于 CephX 的密钥。这个选项不安全，因为它把密钥暴露在了命令行，
用 secretfile 选项可避免此问题。</p>
</dd>
<dt><strong class="command">secretfile</strong></dt><dd><p>包含密钥的文件路径， CephX 要用到。</p>
</dd>
<dt><strong class="command">recover_session=&lt;no|clean&gt;</strong></dt><dd><p>设置重连模式，以防客户端被屏蔽。
可用的模式有 <code class="docutils literal notranslate"><span class="pre">no</span></code> 和 <code class="docutils literal notranslate"><span class="pre">clean</span></code> ，默认是 <code class="docutils literal notranslate"><span class="pre">no</span></code> 。</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">no</span></code>: 客户端探测到自己被屏蔽后永远不要尝试重连。
被屏蔽的客户端不会尝试重连，
并且它们的操作也会失败。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">clean</span></code>: 客户端们探测到自己被屏蔽后会自动重连到 Ceph 集群。
在重连期间，客户端会丢弃脏数据、元数据，使得页缓存和可写的文件句柄失效。
重连后，各文件锁会落伍，因为 MDS 失去了对它们的追踪。
如果一个 inode 内有落伍的文件锁，所有落伍文件锁释放之前，
这个 inode 不允许读写。</p></li>
</ul>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">command<span class="colon">:</span></dt>
<dd class="field-odd"><p><cite>fs=&lt;fs-name&gt;</cite>
使用旧语法时，指定要挂载的非默认文件系统。</p>
</dd>
<dt class="field-even">command<span class="colon">:</span></dt>
<dd class="field-even"><p><cite>mds_namespace=&lt;fs-name&gt;</cite>
“fs=” 的同义词（已废弃）。</p>
</dd>
</dl>
</section>
<section id="id5">
<h3>高级的<a class="headerlink" href="#id5" title="Permalink to this heading"></a></h3>
<dl>
<dt><strong class="command">cap_release_safety</strong></dt><dd><p>整数。默认：自行计算</p>
</dd>
<dt><strong class="command">caps_wanted_delay_max</strong></dt><dd><p>整数，能力释放延迟时间。默认：60</p>
</dd>
<dt><strong class="command">caps_wanted_delay_min</strong></dt><dd><p>整数，能力释放延迟时间。默认：5</p>
</dd>
<dt><strong class="command">dirstat</strong></dt><dd><p>用 <cite>cat dirname</cite> 读取文件信息。默认： off</p>
</dd>
<dt><strong class="command">nodirstat</strong></dt><dd><p>不用 <cite>cat dirname</cite> 读取文件信息</p>
</dd>
<dt><strong class="command">ip</strong></dt><dd><p>本机 IP</p>
</dd>
<dt><strong class="command">noasyncreaddir</strong></dt><dd><p>读目录时不经过 dcache</p>
</dd>
<dt><strong class="command">nocrc</strong></dt><dd><p>写入时不做 crc 校验</p>
</dd>
<dt><strong class="command">noshare</strong></dt><dd><p>创建新客户端例程，而不是和挂载同一集群的例程共享资源。</p>
</dd>
<dt><strong class="command">osdkeepalive</strong></dt><dd><p>整数。默认：5</p>
</dd>
<dt><strong class="command">osd_idle_ttl</strong></dt><dd><p>整数（秒）。默认：60</p>
</dd>
<dt><strong class="command">rasize</strong></dt><dd><p>整数（字节数），最大预读尺寸，默认： 8388608 (8192*1024)</p>
</dd>
<dt><strong class="command">rbytes</strong></dt><dd><p>目录的 st_size 报告产生于目录内容的递归尺寸。默认： on</p>
</dd>
<dt><strong class="command">norbytes</strong></dt><dd><p>目录的 st_size 无需通过递归目录内容来获取。</p>
</dd>
<dt><strong class="command">readdir_max_bytes</strong></dt><dd><p>整数。默认： 524288 （ 512*1024 ）</p>
</dd>
<dt><strong class="command">readdir_max_entries</strong></dt><dd><p>整数。默认： 1024</p>
</dd>
<dt><strong class="command">rsize</strong></dt><dd><p>整数（字节数），最大读尺寸。默认： 16777216 (16*1024*1024)</p>
</dd>
<dt><strong class="command">snapdirname</strong></dt><dd><p>字符串，为快照的隐藏目录设置个名字。默认： .snap</p>
</dd>
<dt><strong class="command">write_congestion_kb</strong></dt><dd><p>整数（ kb ），运行中的最大回写量，随可用内存变化。默认：根据可用内存计算</p>
</dd>
<dt><strong class="command">wsize</strong></dt><dd><p>整数（字节数），最大写尺寸。默认： 16777216 (16*1024*1024)
（回写用较小的 wsize 和条带单元）</p>
</dd>
<dt><strong class="command">wsync</strong></dt><dd><p>同步地执行所有命名空间操作。
这能确保只有收到 MDS 的回复才算命名空间操作完成。</p>
</dd>
<dt><strong class="command">nowsync</strong></dt><dd><p>允许客户端异步执行命名空间操作。
启用此选项后，命名空间操作在收到 MDS 的回复前就可以完成，
如果它有足够的能力这样做。</p>
</dd>
<dt><strong class="command">crush_location=x</strong></dt><dd><p>根据 CRUSH 层次结构指定客户端的位置（自 5.8 版起）。
这是一组用 “|” 分隔的键值对，键值之间用 “:” 分隔。
注意， ‘|’ 可能需要加引号或转义，
以避免被 shell 解释为管道。
键是桶类型的名称（如 rack 、 datacenter
或默认数据桶类型的区域），值是桶的名字。
例如，表示客户端位于机架 “myrack” 、
数据中心 “mydc” 和地区 “myregion” ：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">crush_location</span><span class="o">=</span><span class="n">rack</span><span class="p">:</span><span class="n">myrack</span><span class="o">|</span><span class="n">datacenter</span><span class="p">:</span><span class="n">mydc</span><span class="o">|</span><span class="n">region</span><span class="p">:</span><span class="n">myregion</span>
</pre></div>
</div>
<p>每个键值对都是独立的： myrack 不需要位于 mydc 中，
而 mydc 也不需要位于 myregion 中。
这里的位置不是通向层次结构根节点的路径，
而是一组独立匹配的节点。它支持“多路径”位置，
因此可以在多个并行层次结构里筛选出位置：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">crush_location</span><span class="o">=</span><span class="n">rack</span><span class="p">:</span><span class="n">myrack1</span><span class="o">|</span><span class="n">rack</span><span class="p">:</span><span class="n">myrack2</span><span class="o">|</span><span class="n">datacenter</span><span class="p">:</span><span class="n">mydc</span>
</pre></div>
</div>
</dd>
<dt><strong class="command">read_from_replica=&lt;no|balance|localize&gt;</strong></dt><dd><ul>
<li><p><code class="docutils literal notranslate"><span class="pre">no</span></code>: 禁止读副本，总是选择主 OSD （从 5.8 版起，默认行为）。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">balance</span></code>: 一个多副本存储池收到读请求时，
从这个 PG 的 acting set 里随机选取一个 OSD 提供服务（从 5.8 版起支持）。</p>
<p>此模式只有在 Octopus （即 “ceph osd require-osd-release octopus”
之后）版之后才能安全地随便用；
不是的话，应该仅限于只读载荷，比如快照。</p>
</li>
<li><p><code class="docutils literal notranslate"><span class="pre">localize</span></code>: 当多副本存储池收到读取请求时，
挑选最靠近的 OSD 为其提供服务（自 5.8 版起）。
距离指标是根据 crush_location 给出的客户端位置计算的；
匹配到的等级最低的桶类型获胜。例如，
匹配到机架的 OSD 比匹配到数据中心的 OSD 更接近，
而匹配数据中心的 OSD 又比匹配 region 的 OSD 更接近。</p>
<p>此模式只有在 Octopus （即 “ceph osd require-osd-release octopus”
之后）版之后才能安全地随便用；
不是的话，应该仅限于只读载荷，比如快照。</p>
</li>
</ul>
</dd>
</dl>
</section>
</section>
<section id="id6">
<h2>实例<a class="headerlink" href="#id6" title="Permalink to this heading"></a></h2>
<p>挂载整个文件系统：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span> <span class="o">-</span><span class="n">t</span> <span class="n">ceph</span> <span class="n">fs_user</span><span class="o">@.</span><span class="n">mycephfs2</span><span class="o">=/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span>
</pre></div>
</div>
<p>只挂载命名空间、文件系统的一部分：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span><span class="o">.</span><span class="n">ceph</span> <span class="n">fs_user</span><span class="o">@.</span><span class="n">mycephfs2</span><span class="o">=/</span><span class="n">some</span><span class="o">/</span><span class="n">directory</span><span class="o">/</span><span class="ow">in</span><span class="o">/</span><span class="n">cephfs</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span>
</pre></div>
</div>
<p>传入监视器主机的 IP 地址，可选的：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span><span class="o">.</span><span class="n">ceph</span> <span class="n">fs_user</span><span class="o">@.</span><span class="n">mycephfs2</span><span class="o">=/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span> <span class="o">-</span><span class="n">o</span> <span class="n">mon_addr</span><span class="o">=</span><span class="mf">192.168.0.1</span>
</pre></div>
</div>
<p>如果端口不是标准的，随 IP 传入端口：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span><span class="o">.</span><span class="n">ceph</span> <span class="n">fs_user</span><span class="o">@.</span><span class="n">mycephfs2</span><span class="o">=/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span> <span class="o">-</span><span class="n">o</span> <span class="n">mon_addr</span><span class="o">=</span><span class="mf">192.168.0.1</span><span class="p">:</span><span class="mi">7000</span>
</pre></div>
</div>
<p>如果有多个监视器，传入时用 <cite>/</cite> 分隔开：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span><span class="o">.</span><span class="n">ceph</span> <span class="n">fs_user</span><span class="o">@.</span><span class="n">mycephfs2</span><span class="o">=/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span> <span class="o">-</span><span class="n">o</span> <span class="n">mon_addr</span><span class="o">=</span><span class="mf">192.168.0.1</span><span class="o">/</span><span class="mf">192.168.0.2</span><span class="o">/</span><span class="mf">192.168.0.3</span>
</pre></div>
</div>
<p>传入 CephX 用户的密钥，可选的：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span><span class="o">.</span><span class="n">ceph</span> <span class="n">fs_user</span><span class="o">@.</span><span class="n">mycephfs2</span><span class="o">=/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span> <span class="o">-</span><span class="n">o</span> <span class="n">secret</span><span class="o">=</span><span class="n">AQATSKdNGBnwLhAAnNDKnH65FmVKpXZJVasUeQ</span><span class="o">==</span>
</pre></div>
</div>
<p>传入包含密钥的文件，以免把密钥留在 shell 命令历史里：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span><span class="o">.</span><span class="n">ceph</span> <span class="n">fs_user</span><span class="o">@.</span><span class="n">mycephfs2</span><span class="o">=/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span> <span class="o">-</span><span class="n">o</span> <span class="n">secretfile</span><span class="o">=/</span><span class="n">etc</span><span class="o">/</span><span class="n">ceph</span><span class="o">/</span><span class="n">fs_username</span><span class="o">.</span><span class="n">secret</span>
</pre></div>
</div>
<p>如果 Ceph 集群关闭了认证，忽略与凭证相关的选项：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span><span class="o">.</span><span class="n">ceph</span> <span class="n">fs_user</span><span class="o">@.</span><span class="n">mycephfs2</span><span class="o">=/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span>
</pre></div>
</div>
<p>按照旧语法挂载：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">mount</span> <span class="o">-</span><span class="n">t</span> <span class="n">ceph</span> <span class="mf">192.168.0.1</span><span class="p">:</span><span class="o">/</span> <span class="o">/</span><span class="n">mnt</span><span class="o">/</span><span class="n">mycephfs</span>
</pre></div>
</div>
</section>
<section id="id7">
<h2>使用范围<a class="headerlink" href="#id7" title="Permalink to this heading"></a></h2>
<p><strong>mount.ceph</strong> 是 Ceph 的一部分，这是个伸缩力强、开源、分布式的存储系统，更多信息参见 <a class="reference external" href="https://docs.ceph.com">https://docs.ceph.com</a> 。</p>
</section>
<section id="id8">
<h2>功能适用范围<a class="headerlink" href="#id8" title="Permalink to this heading"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">recover_session=</span></code> 选项是在 v5.4 加进主线内核的。
<code class="docutils literal notranslate"><span class="pre">wsync</span></code> 和 <code class="docutils literal notranslate"><span class="pre">nowsync</span></code> 是在 v5.7 加入的。</p>
</section>
<section id="id9">
<h2>参考<a class="headerlink" href="#id9" title="Permalink to this heading"></a></h2>
<p><a class="reference internal" href="../ceph-fuse/"><span class="doc">ceph-fuse</span></a>(8),
<a class="reference internal" href="../ceph/"><span class="doc">ceph</span></a>(8)</p>
</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../ceph-fuse/" class="btn btn-neutral float-left" title="ceph-fuse -- 基于 FUSE 的 Ceph 客户端" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../mount.fuse.ceph/" class="btn btn-neutral float-right" title="mount.fuse.ceph -- 在 /etc/fstab 里挂载 ceph-fuse" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>